//
//  TokenAddressTableViewCell.m
//  EPBPro
//
//  Created by wucha on 2018/8/1.
//  Copyright © 2018年 fc. All rights reserved.
//

#import "TokenAddressTableViewCell.h"

@interface TokenAddressTableViewCell()
@property (nonatomic,weak) UILabel *nameLabel;
@property (nonatomic,weak) UILabel *addressLabel;

@end

@implementation TokenAddressTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = 0;
        UIButton *button = [UIButton new];
        [button setImage:[UIImage imageNamed:@"unselected1"] forState:UIControlStateNormal];
        [self.contentView addSubview:button];
        button.sd_layout.leftSpaceToView(self.contentView, 10).topSpaceToView(self.contentView, 0).bottomSpaceToView(self.contentView, 0).widthIs(30);
        
        UILabel *nameLabel = [UILabel new];
        nameLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:nameLabel];
        nameLabel.sd_layout.topSpaceToView(self.contentView, 10).leftSpaceToView(button, 10).widthIs(200).heightIs(20);
        self.nameLabel = nameLabel;
        
        UILabel *addressLabel = [UILabel new];
        addressLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:addressLabel];
        addressLabel.sd_layout.topSpaceToView(nameLabel, 0).leftSpaceToView(button, 10).widthIs(200).heightIs(20);
        self.addressLabel = addressLabel;
        
        UIView *lineView = [UIView new];
        lineView.backgroundColor = HexRGB(0xEAEFF1);
        [self.contentView addSubview:lineView];
        lineView.sd_layout.leftSpaceToView(self.contentView, 0).bottomSpaceToView(self.contentView, 0).rightSpaceToView(self.contentView, 0).heightIs(10);
    }
    
    return self;
}

-(void)setTokenAddress:(TokenAddressInfo*)tokenAddressInfo{
    self.nameLabel.text = tokenAddressInfo.addressName;
    self.addressLabel.text = tokenAddressInfo.address;
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
